package com.ygqh.baby.service;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.model.DrawReport;
import com.ygqh.baby.model.PrizeItem;
import com.ygqh.baby.model.PrizeItem.Type;
import com.ygqh.baby.po.YgDrawPrizeRecord;
import com.ygqh.baby.po.YgUser;
import com.ygqh.baby.po.YgUserPrize;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface YgDrawPrizeRecordService {

    List<YgDrawPrizeRecord> find();

    int findCount();

    YgDrawPrizeRecord findById(Long id);

    int deleteSoft(Long[] ids);

    int deleteSoft(Long id);

    int save(YgDrawPrizeRecord ygDrawPrizeRecord);

    int update(YgDrawPrizeRecord ygDrawPrizeRecord);

    int saveOrUpdate(YgDrawPrizeRecord ygDrawPrizeRecord);

    ResultSet<YgDrawPrizeRecord> search(QueryInfo queryInfo, String q);

    int addRecord(PrizeItem prizeItem, YgUser user, String sourceCode);

    YgUserPrize findMyGoodsPrize(Long userId, String sourceCode);

    BigDecimal getGoodsPrizeCount(Long userId, String sourceCode);

    int addCashRecord(Long userId, Long cardId, BigDecimal count, String sourceCode);

    int countByUserId(Long userId, Type type, String sourceCode);

    BigDecimal getTotalRateByUserId(Long userId, Type type, String baseKey);

    ResultSet<DrawReport> drawReport(String sourceCode);

    int findCashCountByUserId(Long userId, String sourceCode, Date startDate, Date endDate, boolean lessRate);

    Map<String, Object> selectDrawSizeTotal(String sourceCode);

    List<YgDrawPrizeRecord> findByRelationCode(String sourceCode, String relationCode);
}
